﻿using System;
using System.Collections.Generic;
using System.Data.Entity;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using OnLineExam.Data;


namespace OnLineExam.AdminLTE.Controllers
{
    public class PaperController : Controller
    {
		private OnlineExamEntities _dbContext;
		private EfRepository<Paper> _paperRepository;
		public PaperController() {
			_dbContext = new OnlineExamEntities();
			_dbContext.Configuration.LazyLoadingEnabled = false;
			_paperRepository = new EfRepository<Paper>(_dbContext);
		}
        // GET: Paper
        public ActionResult Index()
        {
            return View();
        }

		public JsonResult GetListJson() {

			return Json(Newtonsoft.Json.JsonConvert.SerializeObject(_paperRepository.TableNoTracking.ToList()), JsonRequestBehavior.AllowGet);
			using (var ctx=new OnlineExamEntities())
			{
				ctx.Configuration.LazyLoadingEnabled = false;
				var list = ctx.Paper.ToList();
				
			}


			
		}
    }
}